#ifndef IMAGEWIDGET_H
#define IMAGEWIDGET_H

#include <QWidget>
#include <cxcore.h>
#include <QImage>

class ImageWidget : public QWidget
{
    Q_OBJECT
public:
    explicit ImageWidget(QWidget *parent = 0);
    ~ImageWidget();
    IplImage *getCurrentImage();

protected:
    void paintEvent(QPaintEvent *);
    QSize sizeHint() const;

signals:
    void updateSize(const IplImage *img);

public slots:
    void onUpdateImage(const IplImage *frame);

private:
    IplImage *img;
    QImage   *qImg;

};

#endif // IMAGEWIDGET_H
